home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / g_man / cat3 / ftn / addtop.z / addtop
Encoding:
Text File  |  1998-10-20  |  7.2 KB  |  199 lines

  1.  
  2.  
  3.  
  4. aaaaddddddddttttoooopppp((((3333GGGG))))                                                          aaaaddddddddttttoooopppp((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      aaaaddddddddttttoooopppp - adds items to an existing pop-up menu
  10.  
  11. FFFFOOOORRRRTTTTRRRRAAAANNNN 77777777 SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  12.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee aaaaddddddddttttoooopppp((((ppppuuuupppp,,,, ssssttttrrrr,,,, lllleeeennnnggggtttthhhh,,,, aaaarrrrgggg))))
  13.      iiiinnnntttteeeeggggeeeerrrr****4444 ppppuuuupppp
  14.      cccchhhhaaaarrrraaaacccctttteeeerrrr****((((****)))) ssssttttrrrr
  15.      iiiinnnntttteeeeggggeeeerrrr****4444 lllleeeennnnggggtttthhhh,,,, aaaarrrrgggg
  16.  
  17. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  18.      _p_u_p      expects the menu identifier of the menu to which you want to
  19.               add. The menu identifier is the returned function value of the
  20.               menu creation call to nnnneeeewwwwppppuuuupppp.
  21.  
  22.      _s_t_r      expects the variable that contains the text that you want to add
  23.               as a menu item. In addition, you have the option of pairing an
  24.               "item type" flag with each menu item. There are seven menu item
  25.               type flags:
  26.  
  27.               %%%%tttt   marks item text as the menu title string.
  28.  
  29.               %%%%FFFF   invokes a routine for every selection from this menu except
  30.                    those marked with a %n.  You must specify the invoked
  31.                    routine in the _a_r_g parameter.  The value of the menu item
  32.                    is used as a parameter of the executed routine.  Thus, if
  33.                    you select the third menu item, the system passes 3 as a
  34.                    parameter to the function specified by %F.
  35.  
  36.               %%%%ffff   invokes a routine when this particular menu item is
  37.                    selected.  You must specify the invoked routine in the _a_r_g
  38.                    parameter. The value of the menu item is passed as a
  39.                    parameter of the routine.  Thus, if you select the third
  40.                    menu item, the system passes 3 as a parameter to the
  41.                    routine specified by %f.  If you have also used the %F flag
  42.                    within this menu, then the result of the %f routine is
  43.                    passed as a parameter of the %F routine.
  44.  
  45.               %%%%llll   adds a line under the current entry.  You can use this as a
  46.                    visual cue to group like entries together.
  47.  
  48.               %%%%mmmm   pops up a menu whenever this menu item is selected. You
  49.                    must provide the menu identifier of the new menu in the _a_r_g
  50.                    parameter.
  51.  
  52.               %%%%nnnn   like %f, this flag invokes a routine when the user selects
  53.                    this menu item.  However, %n differs from %f in that it
  54.                    ignores the routine (if any) specified by %F. The value of
  55.                    the menu item is passed as a parameter of the executed
  56.                    routine.  Thus, if you select the third menu item, the
  57.                    system passes 3 as a parameter to the function specified by
  58.                    %f.
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. aaaaddddddddttttoooopppp((((3333GGGG))))                                                          aaaaddddddddttttoooopppp((((3333GGGG))))
  71.  
  72.  
  73.  
  74.               %%%%xxxx_n  assigns a numeric value to this menu item.  This values
  75.                    overrides the default position-based value assigned to this
  76.                    menu item (e.g., the third item is 3).  You must enter the
  77.                    numeric value as the _n part of the text string.  Do not use
  78.                    the _a_r_g parameter to specify the numeric value.
  79.  
  80.               NNNNOOOOTTTTEEEE:::: If you use the vertical bar delimiter, "|", you can
  81.               specify multiple menu items in a text string.  However, because
  82.               there is only one _a_r_g parameter, the text string can contain no
  83.               more than one item type that references the _a_r_g parameter.
  84.  
  85.      _l_e_n_g_t_h   expects the length of the string pointed to by the _s_t_r
  86.               parameter.
  87.  
  88.      _a_r_g      expects the command or submenu that you want to assign to the
  89.               menu item.  You can have only one _a_r_g parameter for each call to
  90.               aaaaddddddddttttoooopppp.  If the _a_r_g parameter is not needed, use 0 as a place
  91.               holder.
  92.  
  93. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  94.      aaaaddddddddttttoooopppp adds items to the bottom of an existing pop-up menu.  You can
  95.      build a menu by using a call to nnnneeeewwwwppppuuuupppp to create a menu, followed by a
  96.      call to aaaaddddddddttttoooopppp for each menu item that you want to add to the menu. To
  97.      activate and display the menu, submit the menu to ddddooooppppuuuupppp.
  98.  
  99. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  100.      This example creates a menu with a submenu:
  101.  
  102.           submenu = newpup()
  103.           call addtop(submen, 'rotate %f', 9,  dorota)
  104.           call addtop(submen, 'translate %f', 12, dotran)
  105.           call addtop(submen, 'scale %f', 8, doscal)
  106.           menu = newpup()
  107.           call addtop(menu, 'sample %t', 9, 0)
  108.           call addtop(menu, 'persp', 5, 0)
  109.           call addtop(menu, 'xform %m', 8, submenu)
  110.           call addtop(menu, 'greset %f', 9, greset)
  111.  
  112.  
  113.      Because neither the "sample" menu title nor the "persp" menu item refer
  114.      to the _a_r_g parameter, you can group "sample", "persp", and "xform" in a
  115.      single call.
  116.  
  117.           call addtop(menu, 'sample %t | persp | xform %m', 28,
  118.          +                  submenu)
  119.  
  120.  
  121. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  122.      dopup, freepup, newpup, setpup
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. aaaaddddddddttttoooopppp((((3333GGGG))))                                                          aaaaddddddddttttoooopppp((((3333GGGG))))
  137.  
  138.  
  139.  
  140. NNNNOOOOTTTTEEEESSSS
  141.      This routine is available only in immediate mode.
  142.  
  143.      When using the Distributed Graphics Library (DGL), you can not call other
  144.      DGL routines within a function that is called by a popup menu, i.e. a
  145.      function given as the argument to a %f or %F item type.
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.